<extend name="Public:innerbase" />
<block name="css">
<style class="text/css">
.tab-content{
	padding: 20px 10px 0;
}
</style>
</block>
<block name="js">
<include file="Public:upload" />
<script src="{:RES}/js/date/WdatePicker.js"></script>
</block>
<block name="content">
<div class="container-fluid">
	<div class="page-header wm-page-header">
		<h4>编辑刮刮卡活动</h4>
		<a href="{:U('Guajiang/index')}" class="btn btn-default btn-sm">
			<span class="glyphicon glyphicon-chevron-left"></span>&nbsp;返回
		</a>
	</div>
	<!-- Nav tabs -->
	<ul class="nav nav-tabs wm-tabs">
		<li class="active"><a href="#start" data-toggle="tab">活动开始设置</a></li>
		<li><a href="#end" data-toggle="tab">活动结束设置</a></li>
		<li><a href="#prize" data-toggle="tab">奖项设置</a></li>
	</ul>
	<!-- Tab panes -->
	<form class="form-horizontal" method="post">
		<input type="hidden" value="2" name="type" />
		<div class="tab-content">
			<div class="tab-pane active" id="start">
				<div class="form-group">
					<label class="col-sm-2">关键词</label>
					<div class="col-md-5">
						<input type="input" class="form-control" id="keyword" value="<if condition="$vo['keyword'] eq ''">刮刮卡<else/>{$vo.keyword}</if>" name="keyword" />
					</div>
					<span class="col-md-5 text-info">用户输入此关键词将会触发此活动</span>
				</div>
				<div class="form-group">
					<label class="col-sm-2">活动名称</label>
					<div class="col-md-5">
						<input type="input" class="form-control" id="title" value="<if condition="$vo['title'] eq ''">刮刮卡活动开始了<else/>{$vo.title}</if>" name="title" />
					</div>
					<span class="col-md-5 text-info">请不要超过50个字!</span>
				</div>
				<div class="form-group">
					<label for="img" class="col-sm-2">活动开始图片</label>
					<div class="col-sm-6" >
						<?php if($vo['startpicurl'] == 0){ $vo['startpicurl']=rtrim(C('site_url'),'/').'/Public/Wap/css/guajiang/images/activity-scratch-card-start.jpg';}?>
						<input type="hidden" name="startpicurl" value="{$vo.startpicurl}"  id="pic1" />
						<img id="pic1Holder" style="width:216px;height:120px;" class="img" src="{$vo.startpicurl}"/>
						<div class="btn-group" style="vertical-align:bottom;">
							<span class="btn btn-xs btn-primary" onclick="selectAsset('pic1',720,400)">
								<span class="glyphicon glyphicon-cloud-upload"></span>选择
							</span>
							<span class="btn btn-primary btn-xs" onclick="previewImg('pic1')">
								<span class="glyphicon glyphicon-picture"></span>预览
							</span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">活动时间</label>
					<div class="col-md-2">
						<input type="input" class="form-control" id="startdate" value="<if condition="$vo['startdate'] neq ''">{$vo.startdate|date="Y-m-d H:i:s",###}<else/><?php echo date('Y-m-d H:i:s',mktime(0, 0, 0, date("m")  , date("d"), date("Y")));?></if>" onClick="WdatePicker()" name="startdate" />
					</div>
					<span class="col-sm-1" style="text-align:center;">至</span>
					<div class="col-md-2">
						<input type="input" class="form-control" id="enddate" value="<if condition="$vo['enddate'] neq ''">{$vo.enddate|date="Y-m-d H:i:s",###}<else/><?php echo date('Y-m-d H:i:s',mktime(0, 0, 0, date("m")  , date("d")+3, date("Y")));?></if>" name="enddate" onClick="WdatePicker()"  />  
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">活动说明</label>
					<div class="col-md-5">
						<textarea  class="form-control" id="info" name="info"  style="height:125px" ><if condition="$vo['info'] eq ''">亲，请点击进入刮刮卡活动页面，祝您好运哦！<else/>{$vo.info}</if></textarea>
					</div>
					<span class="col-md-5 text-info">换行请输入&lt;br&gt;</span>
				</div>
				<div class="form-group">
					<label class="col-sm-2">重复抽奖时提示</label>
					<div class="col-md-5">
						<input type="text" class="form-control" id="aginfo" value="<if condition="$vo['aginfo'] eq ''">亲，继续努力哦！<else/>{$vo.aginfo}</if>" name="aginfo" /> 
					</div>
					<span class="col-md-5 text-info">备注:如果设置只允许抽一次奖的，请写：你已经玩过了，下次再来。如果设置可多次抽奖，请写：亲，继续努力哦！</span>
				</div>
				<div class="form-group">
					<label class="col-sm-2">中奖时提示</label>
					<div class="col-md-5">
						<input type="text" class="form-control" id="sttxt" value="<if condition="$vo['sttxt'] eq ''">恭喜您，中奖啦！<else/>{$vo.sttxt}</if>" name="sttxt" /> 
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">兑奖说明</label>
					<div class="col-md-5">
						<textarea class="form-control" id="txt" name="txt" style="height: 125px;">{$vo.txt}</textarea>
					</div>
					<span class="col-md-5 text-info">请不要多于100字! 这个设定但用户输入兑奖时候的显示信息!</span>
				</div>
				
			</div>
			<!--活动结束设置 -->
			<div class="tab-pane" id="end">
				<div class="form-group">
					<label class="col-sm-2">活动结束公告标题</label>
					<div class="col-md-5">
						<input type="input" class="form-control" id="endtite" value="<if condition="$vo['endtite'] eq ''">刮刮卡活动已结束<else/>{$vo.endtite}</if>" name="endtite" />
					</div>
					<span class="col-md-5 text-info">请不要多于100字! 这个设定但用户输入兑奖时候的显示信息!</span>
				</div>
				<div class="form-group">
					<label for="img" class="col-sm-2">活动结束图片</label>
					<div class="col-sm-6" >
						<?php if($vo['endpicurl'] == 0){ $vo['endpicurl']=rtrim(C('site_url'),'/').'/Public/Wap/css/guajiang/images/activity-scratch-card-end.jpg';}?>
						<input type="hidden" name="endpicurl" value="{$vo.endpicurl}"  id="pic2" />
						<img id="pic2Holder" style="width:216px;height:120px;" class="img" src="{$vo.endpicurl}"/>
						<div class="btn-group" style="vertical-align:bottom;">
							<span class="btn btn-xs btn-primary" onclick="selectAsset('pic2',720,400)">
								<span class="glyphicon glyphicon-cloud-upload"></span>选择
							</span>
							<span class="btn btn-primary btn-xs" onclick="previewImg('pic2')">
								<span class="glyphicon glyphicon-picture"></span>预览
							</span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">活动结束说明</label>
					<div class="col-md-5">
						<textarea  class="form-control" id="endinfo" name="endinfo"  style="height:125px" ><if condition="$vo['endinfo'] eq ''">亲，活动已经结束，请继续关注我们的后续活动哦！<else/>{$vo.endinfo}</if></textarea>
					</div>
					<span class="col-md-5 text-info">换行请输入&lt;br&gt;</span>
				</div>
			</div>
			<!-- 奖项设置-->
			<div class="tab-pane" id="prize">
				<div class="form-group">
					<label class="col-sm-2">一等奖</label>
					<div class="col-md-4">
						<div class="input-group">
							<span class="input-group-addon">奖品</span>
							<input type="input" class="form-control" id="fist"  name="fist" value="{$vo.fist}" />
						</div>
					</div>
					<div class="col-md-2">
						<div class="input-group">
							<span class="input-group-addon">数量</span>
							<input type="text" class="form-control" id="fistnums" name="fistnums" value="{$vo.fistnums}" />
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">二等奖</label>
					<div class="col-md-4">
						<div class="input-group">
							<span class="input-group-addon">奖品</span>
							<input type="input" class="form-control" id="second"  name="second" value="{$vo.second}" />
						</div>
					</div>
					<div class="col-md-2">
						<div class="input-group">
							<span class="input-group-addon">数量</span>
							<input type="text" class="form-control" id="secondnums" name="secondnums" value="{$vo.secondnums}" />
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">三等奖</label>
					<div class="col-md-4">
						<div class="input-group">
							<span class="input-group-addon">奖品</span>
							<input type="input" class="form-control" id="third"  name="third" value="{$vo.third}" />
						</div>
					</div>
					<div class="col-md-2">
						<div class="input-group">
							<span class="input-group-addon">数量</span>
							<input type="text" class="form-control" id="thirdnums" name="thirdnums" value="{$vo.thirdnums}" />
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">四等奖</label>
					<div class="col-md-4">
						<div class="input-group">
							<span class="input-group-addon">奖品</span>
							<input type="input" class="form-control" id="four"  name="four" value="{$vo.four}" />
						</div>
					</div>
					<div class="col-md-2">
						<div class="input-group">
							<span class="input-group-addon">数量</span>
							<input type="text" class="form-control" id="fournums" name="fournums" value="{$vo.fournums}" />
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">五等奖</label>
					<div class="col-md-4">
						<div class="input-group">
							<span class="input-group-addon">奖品</span>
							<input type="input" class="form-control" id="five"  name="five" value="{$vo.five}" />
						</div>
					</div>
					<div class="col-md-2">
						<div class="input-group">
							<span class="input-group-addon">数量</span>
							<input type="text" class="form-control" id="fivenums" name="fivenums" value="{$vo.fivenums}" />
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">六等奖</label>
					<div class="col-md-4">
						<div class="input-group">
							<span class="input-group-addon">奖品</span>
							<input type="input" class="form-control" id="six"  name="six" value="{$vo.six}" />
						</div>
					</div>
					<div class="col-md-2">
						<div class="input-group">
							<span class="input-group-addon">数量</span>
							<input type="text" class="form-control" id="fistnums" name="sixnums" value="{$vo.sixnums}" />
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">预计活动的人数</label>
					<div class="col-md-4">
						<input type="input" class="form-control" id="allpeople" name="allpeople"  value="{$vo.allpeople}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2">每人允许抽奖次数</label>
					<div class="col-md-4">
						<input type="input" class="form-control" id="canrqnums" name="canrqnums"   value="{$vo.canrqnums}" />
					</div>
					<span class="col-md-5 text-info">预估活动人数直接影响抽奖概率：中奖概率 = 奖品总数/(预估活动人数*每人抽奖次数) <br/><span class='text-warning'>如果要确保任何时候都100%中奖建议设置为1人参加!并且奖项只设置一等奖.</span></span>
				</div>
				<div class="form-group">
					<label class="col-sm-2">兑奖密码</label>
					<div class="col-md-4">
						<input class="form-control" id="parssword" name="parssword" value="{$vo.parssword}" style="width:150px" type="input" />
					</div>
					<span class="col-md-5 text-info">消费确认密码长度小于15位 不设置密码,兑奖页面的密码输入框则不出现</span>
				</div>
				<div class="form-group">
					<label class="col-sm-2">SN码重命名为</label>
					<div class="col-md-4">
						<input class="form-control" id="renamesn" name="renamesn" value="<if condition="$vo.renamesn">{$vo.renamesn}<else/>SN码</if>"  type="input" /> 
					</div>
					<span class="col-md-5 text-info">例如：CND码,充值密码,SN码。这个主要用于修改SN码的名称</span>
				</div>
				<div class="form-group">
					<label class="col-sm-2">手机号码重命名为</label>
					<div class="col-md-4">
						<input class="form-control" id="renametel" name="renametel" value="<if condition="$vo.renametel">{$vo.renametel}<else/>手机号</if>"  type="input" />
					</div>
					<span class="col-md-5 text-info">例如：QQ号,微信号,手机号等其他联系方式</span>
				</div>
				<div class="form-group">
					<label class="col-sm-2">是否显示奖品数量</label>
					<div class="col-md-5">
						<label><input type="radio" name="displayjpnums" value="1"  <if condition="$vo['displayjpnums'] eq 1" >checked</if> >显示 </label> <label><input type="radio" name="displayjpnums" value="0"  <if condition="$vo['displayjpnums'] eq 0" >checked</if>>不显</label>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-md-5 col-sm-offset-2">
				<input type="submit" class="btn btn-primary" value="保存" />
			</div>
		</div>
	</form>
</div>
</block>
<script src="{:STATICS}/artDialog/jquery.artDialog.js?skin=default"></script>
<script src="{:STATICS}/artDialog/plugins/iframeTools.js"></script>
<script src="{:RES}/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="{:STATICS}/qiniu.js"></script>
<form class="form" method="post" action="" enctype="multipart/form-data" >
<div class="content">
<!--活动开始-->
<div class="cLineB">
    <h4>编辑刮刮卡活动开始内容</h4>
	<a href="{:U('Guajiang/index')}"  class="right btnGrayS vm" style="margin-top:-27px" >返回</a>
</div> 
<div class="msgWrap bgfc"> 
<TABLE class="userinfoArea" style=" margin:0;" border="0" cellSpacing="0" cellPadding="0" width="100%"><TBODY>
<TR>
  <th valign="top"><span class="red">*</span>关键词：</th>
  <TD>
	<input type="input" class="px" id="keyword" value="<if condition="$vo['keyword'] eq ''">刮刮卡<else/>{$vo.keyword}</if>" name="keyword" style="width:400px" ><br />
  	<span class="red">只能写一个关键词</span>，用户输入此关键词将会触发此活动。
  </TD>
  <TD rowspan="7" valign="top">
	  <div style="margin-left:20px">
		<img id="pic1_src" src="<if condition="$vo['startpicurl'] eq 0">{:RES}/images/img/activity-scratch-card-start.jpg<else/>{$vo.startpicurl}</if>" width="373px" >	
		<br />
		<input class="px" id="pic1" name="startpicurl" value="<if condition="$vo['startpicurl'] eq 0">{:C('site_url')}/Tpl/User/default/common/images/img/activity-scratch-card-start.jpg<else/>{$vo.startpicurl}</if>"   onclick="document.getElementById('pic1_src').src=this.value;" style="width:363px;"  />
		<br />
		<input name="type" value="2" type="hidden" />
		<a href="javascript:void(0)" onclick="selectAsset('pic1',700,420)" class="a_upload">上传</a>
		<a href="javascript:void(0)" onclick="previewImg('pic1')">预览</a>&nbsp;活动开始图片
	  </div>
	</TD>
</TR>
<TR>
  <th valign="top"><span class="red">*</span>活动名称：</th>
  <TD>
	<input type="input" class="px" id="title" value="<if condition="$vo['title'] eq ''">刮刮卡活动开始了<else/>{$vo.title}</if>" name="title" style="width:400px" />
  	<br />
  	请不要多于50字!
  </TD>
  <TR>
  	<th valign="top"><span class="red">*</span>兑奖信息：</th>
  	<td>
		<input type="input" class="px" id="txt" value="<if condition="$vo['txt'] eq ''">兑奖请联系我们，电话18950099999<else/>{$vo.txt}</if>" name="txt" style="width:400px" />
  		<br />请不要多于100字! 这个设定但用户输入兑奖时候的显示信息!
	</td>
  </TR>
 <TR>
  	<th valign="top"><span class="red">*</span>中奖提示：</th>
  	<td>
		<textarea class="px"   name="sttxt" style="width:400px"  >{$vo.sttxt}</textarea>
	</td>
</TR>
<TR>
	<th><span class="red">*</span>活动时间：</th>
	<td><input type="input" class="px" id="startdate" value="<if condition="$vo['startdate'] neq ''">{$vo.startdate|date="Y-m-d H:i:s",###}<else/><?php 
	echo date('Y-m-d H:i:s',mktime(0, 0, 0, date("m")  , date("d"), date("Y")));?></if>" onClick="WdatePicker()" name="startdate" />                
		到
	<input type="input" class="px" id="enddate" value="<if condition="$vo['enddate'] neq ''">{$vo.enddate|date="Y-m-d H:i:s",###}<else/><?php 
	echo date('Y-m-d H:i:s',mktime(0, 0, 0, date("m")  , date("d")+3, date("Y")));?></if>" name="enddate" onClick="WdatePicker()"  /> 
	</td>
</TR>
<TR>
<th valign="top">活动说明：</th>
<td><textarea  class="px" id="info" name="info"  style="width:400px; height:125px" ><if condition="$vo['info'] eq ''">亲，请点击进入刮刮卡抽奖活动页面，祝您好运哦！<else/>{$vo.info}</if></textarea><br />换行请输入
 &lt;br&gt;
 </td>
</TR>
</TBODY>
</TABLE>
  </div> 
  
<!--活动结束-->
<div class="cLineB">
          	<h4>活动结束内容</h4></div> 
<div class="msgWrap bgfc">
 
  	<table class="userinfoArea" style=" margin: 0;" border="0" cellspacing="0" cellpadding="0" width="100%">
  		<tbody>
  			<tr>
  				<th valign="top"><span class="red">*</span>活动结束公告主题：</th>
  				<td><input type="input" class="px" id="endtite" value="<if condition="$vo['endtite'] eq ''">刮刮卡活动已经结束了<else/>{$vo.endtite}</if>" name="endtite" style="width:400px" />
  				<br />
  					请不要多于50字! </td>
  				<td rowspan="4" valign="top"><div style="margin-left:20px"><img  id="pic2_src" src="<if condition="$vo['endpicurl'] eq 0">
				{:C('site_url')}/Tpl/User/default/common/images/img/activity-scratch-card-end.jpg<else/>{$vo.endpicurl}</if>"  width="373px"/> <br />
  					<input class="px" id="pic2" name="endpicurl" value="<if condition="$vo['endpicurl'] eq 0">{:C('site_url')}/Tpl/User/default/common/images/img/activity-scratch-card-end.jpg<else/>{$vo.endpicurl}</if>"  onchange="document.getElementById('pic2_src').src=this.value;"  style="width:363px;"  />
  					<br />
					<a href="javascript:void(0)" onclick="selectAsset('pic2',700,420)" class="a_upload">上传</a>
					<a href="javascript:void(0)" onclick="previewImg('pic2')">预览</a>&nbsp;活动结束图片
					</div>
				</td>
  			</tr>
  			<tr>
  				<th valign="top">活动结束说明：</th>
  				<td valign="top"><textarea  class="px" id="endinfo" name="endinfo"  style="width:400px; height:125px" ><if condition="$vo['endinfo'] eq ''">亲，活动已经结束，请继续关注我们的后续活动哦。<else/>{$vo.endinfo}</if></textarea><br />换行请输入
 &lt;br&gt;
  				  </td>
  				</tr>
  			</tbody>
  		</table>
  </div> 
  
  
<!--奖项设置-->
<div class="cLineB">
          	<h4>奖项设置</h4></div> 
<div class="msgWrap bgfc">

<TABLE class="userinfoArea" style=" margin: 0;" border="0" cellSpacing="0" cellPadding="0" width="100%">
<TBODY>
<TR>
<th valign="top"><span class="red">*</span>一等奖奖品设置：</th>
<td><input type="input" class="px" id="fist"   name="fist" value="{$vo.fist}"  style="width:250px"/>
请不要多于50字! </td>
  <TD rowspan="9" valign="top">&nbsp;</TD>
</TR>
<TR>
<th valign="top"><span class="red">*</span>一等奖奖品数量：</th>
<td><input type="input" class="px" id="fistnums" name="fistnums" value="{$vo.fistnums}" style="width:60px" />
<span class="red">如果是100%中奖,请把一等奖的奖品数量[ 1000就代表前1000人都中奖 ]填写多点</span></td>
</TR>
<TR>
<th valign="top">二等奖奖品设置：</th>
<td><input type="input" class="px" id="second" name="second"     value="{$vo.second}"  style="width:250px"/>
请不要多于50字! </td>
</TR>
<TR>
<th valign="top">二等奖奖品数量：</th>
<td><input type="input" class="px" id="secondnums" name="secondnums"   value="{$vo.secondnums}" style="width:60px" />
</td>
</TR>
<TR>
<th valign="top">三等奖奖品设置：</th>
<td><input type="input" class="px" id="third" name="third"   value="{$vo.third}" style="width:250px" />
请不要多于50字! </td>
</TR>
<TR>
<th valign="top">三等奖奖品数量：</th>
<td><input type="input" class="px" id="thirdnums" name="thirdnums"     value="{$vo.thirdnums}" style="width:60px" />
</td>
 </TR>
  </tbody>
 <tbody>
<TR>
<th valign="top"><span class="red">*</span>预计活动的人数：</th>
<td><input type="input" class="px" id="allpeople" name="allpeople"   value="{$vo.allpeople}" style="width:150px"/>  预估活动人数直接影响抽奖概率：中奖概率 = 奖品总数/(预估活动人数*每人抽奖次数) 如果要确保任何时候都100%中奖建议设置为1人参加!<span class='red'>如果要确保任何时候都100%中奖建议设置为1人参加!并且奖项只设置一等奖.</span></td>
</TR>
<TR>
<th valign="top"><span class="red">*</span>每人最多允许抽奖次数：</th>
<td><input type="input" class="px" id="canrqnums" name="canrqnums"   value="{$vo.canrqnums}" style="width:150px"/>
必须1-5之间的数字</td>
 </TR>

<TR>
	<th valign="top">抽奖页面是否显示奖品数量：</th>
	<td><input class="radio" type="radio" name="displayjpnums" value="1"  <if condition="$vo['displayjpnums'] eq 1" >checked</if> >显示  <input class="radio" type="radio" name="displayjpnums" value="0"  <if condition="$vo['displayjpnums'] eq 0" >checked</if>>不显</td> 
</TR> 
<TR>
<th>&nbsp;</th>
<td>
	<button type="submit" class="btnGreen" >保存</button>
	<a href="{:U('Guajiang/index')}"  class="btnGray vm">取消</a>
	<span class="red">请确认功能管理已开启大转盘功能</span>
</td>
</TBODY>
</TABLE>
  </div> 
 </div>
</form>
<div class="clr"></div>
</div>
</div>
</div> 
<script type="text/javascript">
	//onFocus事件就是当光标落在文本框中时发生的事件。
	//onBlur事件是光标失去焦点时发生的事件。
	function onfocus(obj){
		obj.html = '';
	}
	function onblur(obj,str){
		obj.html = str;
	}
  </script>
<!--底部-->
</div>
</body>
</html>